package com.mostromas.ess.inventory.controller;

import com.mostromas.ess.inventory.req.StockInREQ;
import com.mostromas.ess.inventory.service.IStockInService;
import com.mostromas.ess.util.base.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 入库单
 */
@Api(value = "入库单管理接口",description = "入库单管理接口，提供入库单的增、删、改、查")
@RestController //所有方法都会返回json字符串进行相应
@RequestMapping("/stock_in")
public class StockInController {

    @Autowired
    private IStockInService stockInService;

    @PreAuthorize(("hasAuthority('stock_in:search')"))
    @ApiOperation("根据入库单ID、仓库ID、款号、审核状态、时间段查询入库单列表接口")
    @PostMapping("/search")
    public Result search(@RequestBody StockInREQ req){
        return stockInService.queryPage(req);
    }
}
